//
//  GCDBarrier.m
//  Demo
//
//  Created by tianXin on 2017/8/30.
//  Copyright © 2017年 田鑫. All rights reserved.
//

#import "GCDBarrier.h"

@implementation GCDBarrier

+ (void)executeInSyncQueue:(GCDQueue *)queue block: (dispatch_block_t)block{
  
  NSParameterAssert(block);
  dispatch_barrier_sync(queue.dispatchQueue, block);
}

+ (void)executeInAsyncQueue:(GCDQueue *)queue block:(dispatch_block_t)block {
  
  NSParameterAssert(block);
  dispatch_barrier_sync(queue.dispatchQueue, block);
}

+ (void)executeInQueue:(dispatch_queue_t)queue block:(dispatch_block_t)block {
  
  NSParameterAssert(block);
  NSParameterAssert(queue);
  dispatch_barrier_sync(queue, block);
}

@end
